/*
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */
package utopiaintelpackage;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * A class that represents intel
 * 
 * 
 */
public abstract class AbstractIntel {
   private final Map<String, Object> intel;

   public AbstractIntel() {
	  intel = new HashMap<String, Object>();
   }

   /**
    * @return Map<String,Object> holding all the intel parameters
    */
   public Map<String, Object> getIntel() {
	  return intel;
   }

   /**
    * Returns a list of strings to be sent to IRC
    * 
    * @param shortVersion
    * @return a list of strings to be sent to IRC
    */
   public abstract List<String> getIRCOutput(boolean shortVersion);

   /**
    * Returns the specified parameter from the intel map
    * 
    * @param parameter
    * @return Object representing an intel parameter
    */
   public Object getParameter(final String parameter) {
	  return intel.get(parameter);
   }

   /**
    * Returns a map containing information about the bot object that can be sent via XML-RPC
    * 
    * @param args
    *           Defines how much of the information available to include in the map
    * @return a map containing information about the bot object that can be sent via XML-RPC
    */
   public abstract Map<String, Object> getRPCOutput(int... args);

   /**
    * @return String representing the type of intel
    */
   public abstract String getTypeOfIntel();

   /**
    * @return boolean true if this intel object has all the necessary parameters
    */
   public abstract boolean isComplete();

   /**
    * Adds an intel parameter
    * 
    * @param parameter
    * @param value
    */
   public void setParameter(final String parameter, final Object value) {
	  intel.put(parameter, value);
   }

}
